//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if compiler(>=5.5.2) && canImport(_Concurrency)

import SotoCore

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SimSpaceWeaver {
    // MARK: Async API Calls

    /// Deletes the instance of the given custom app.
    public func deleteApp(_ input: DeleteAppInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteAppOutput {
        return try await self.client.execute(operation: "DeleteApp", path: "/deleteapp", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Deletes all SimSpace Weaver resources assigned to the given simulation.  Your simulation uses resources in other Amazon Web Services services. This API operation doesn't delete resources in other Amazon Web Services services.
    public func deleteSimulation(_ input: DeleteSimulationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteSimulationOutput {
        return try await self.client.execute(operation: "DeleteSimulation", path: "/deletesimulation", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Returns the state of the given custom app.
    public func describeApp(_ input: DescribeAppInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DescribeAppOutput {
        return try await self.client.execute(operation: "DescribeApp", path: "/describeapp", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Returns the current state of the given simulation.
    public func describeSimulation(_ input: DescribeSimulationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DescribeSimulationOutput {
        return try await self.client.execute(operation: "DescribeSimulation", path: "/describesimulation", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists all custom apps or service apps for the given simulation and domain.
    public func listApps(_ input: ListAppsInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListAppsOutput {
        return try await self.client.execute(operation: "ListApps", path: "/listapps", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists the SimSpace Weaver simulations in the Amazon Web Services account used to make the API call.
    public func listSimulations(_ input: ListSimulationsInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListSimulationsOutput {
        return try await self.client.execute(operation: "ListSimulations", path: "/listsimulations", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists all tags on a SimSpace Weaver resource.
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListTagsForResourceOutput {
        return try await self.client.execute(operation: "ListTagsForResource", path: "/tags/{ResourceArn}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Starts a custom app with the configuration specified in the simulation schema.
    public func startApp(_ input: StartAppInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StartAppOutput {
        return try await self.client.execute(operation: "StartApp", path: "/startapp", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Starts the simulation clock.
    public func startClock(_ input: StartClockInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StartClockOutput {
        return try await self.client.execute(operation: "StartClock", path: "/startclock", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Starts a simulation with the given name and schema.
    public func startSimulation(_ input: StartSimulationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StartSimulationOutput {
        return try await self.client.execute(operation: "StartSimulation", path: "/startsimulation", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Stops the given custom app and shuts down all of its allocated compute resources.
    public func stopApp(_ input: StopAppInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StopAppOutput {
        return try await self.client.execute(operation: "StopApp", path: "/stopapp", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Stops the simulation clock.
    public func stopClock(_ input: StopClockInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StopClockOutput {
        return try await self.client.execute(operation: "StopClock", path: "/stopclock", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Stops the given simulation.  You can't restart a simulation after you stop it.  If you need to restart a simulation, you must stop it, delete it,  and start a new instance of it.
    public func stopSimulation(_ input: StopSimulationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StopSimulationOutput {
        return try await self.client.execute(operation: "StopSimulation", path: "/stopsimulation", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Adds tags to a SimSpace Weaver resource. For more information about tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> TagResourceOutput {
        return try await self.client.execute(operation: "TagResource", path: "/tags/{ResourceArn}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Removes tags from a SimSpace Weaver resource. For more information about tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UntagResourceOutput {
        return try await self.client.execute(operation: "UntagResource", path: "/tags/{ResourceArn}", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SimSpaceWeaver {
    ///  Lists all custom apps or service apps for the given simulation and domain.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listAppsPaginator(
        _ input: ListAppsInput,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListAppsInput, ListAppsOutput> {
        return .init(
            input: input,
            command: self.listApps,
            inputKey: \ListAppsInput.nextToken,
            outputKey: \ListAppsOutput.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  Lists the SimSpace Weaver simulations in the Amazon Web Services account used to make the API call.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listSimulationsPaginator(
        _ input: ListSimulationsInput,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListSimulationsInput, ListSimulationsOutput> {
        return .init(
            input: input,
            command: self.listSimulations,
            inputKey: \ListSimulationsInput.nextToken,
            outputKey: \ListSimulationsOutput.nextToken,
            logger: logger,
            on: eventLoop
        )
    }
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
